{include file="public_head" /}



<!-- datatables -->

<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>

<!-- chk_3 -->

<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>



<body class="nav-md">



<div class="container body">





    <div class="main_container">



        {include file="public_sidebar,public_nav" /}



        <!-- page content -->

        <div class="right_col" role="main">

            <div class="">

                <div class="page-title">

                    <div class="title_left">

                        <h3>

                            礼包二级订单

                        </h3>

                    </div>

                </div>

                <div class="clearfix"></div>



                <div class="row">



                    <div class="col-md-12 col-sm-12 col-xs-12">

                        <div class="x_panel">

                            <div class="x_title">

                                <h2>礼包二级订单</h2>

                                <a style="float: right" href="{:url('create',['order_id' => input('order_id')])}"

                                   class="btn btn-success btn-sm">创建二级订单</a>

                                <div class="clearfix"></div>

                            </div>

                            <div class="x_content">

                                <form name="form" id="form" method="get" action="">



                                    <div class="title_left">

                                        <div class="input-group" style="float: left;margin: 0 20px;">

                                            <input type="text" class="form-control" name="interval_timer"

                                                   id="interval_timer"

                                                   style="width: 200px;"

                                                   placeholder="请选择时间区间..." value="{:input('interval_timer')}">

                                        </div>



                                        <div class="col-md-2 col-sm-3 col-xs-6 form-group pull-left top_search">

                                            <div class="input-group">

                                                <input type="text" class="form-control" name="title"

                                                       placeholder="输入搜索内容..." value="{:input('title')}">

                                            </div>

                                        </div>

                                        <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索

                                        </button>

                                    </div>



                                    <table style="border-bottom:1px solid #ddd;"

                                           class="table table-striped table-bordered table-hover">

                                        <thead>

                                        <tr>

                                            <!--<th style="width: 2%; padding: 10px;">-->

                                                <!--<input type="checkbox" class="checkall"-->

                                                       <!--onclick="CheckAll(this.checked);"/>-->

                                            <!--</th>-->

                                            <!--<th>排序</th>-->

                                            <th>ID</th>

                                            <th>买家账号(车牌号)</th>

                                            <th>订单号</th>

                                            <th>送检人员</th>

                                            <th>手机号码</th>

                                            <th>车主姓名</th>

                                            <th>车主号码</th>

                                            <th>车牌号码</th>

                                            <th>车辆识别码</th>

                                            <th>发动机号</th>

                                            <th>品牌型号</th>

                                            <th>注册日期</th>

                                            <th>创建日期</th>

                                            <th>是否确认</th>

                                            <th>图片</th>

                                            <!--<th>是否启用</th>-->

                                            <th>操作</th>

                                        </tr>

                                        </thead>

                                        <tbody>

                                        {empty name="data"}

                                        <tr>

                                            <td colspan="5">

                                                <div style='font-size:24px;margin:30px 0;'>没有找到记录</div>

                                            </td>

                                        </tr>

                                        {/empty}

                                        {volist name="data" id="item"}

                                        <tr>

                                            <td>{$item.id}</td>

                                            <td>{$item.username}({$item.car_number})</td>

                                            <td>{$item.order_number_two}</td>



                                            <td>{$item.sjyr}</td>

                                            <td>{$item.tel}</td>

                                            <td>{$item.car_name}</td>

                                            <td>{$item.car_tel}</td>

                                            <td>{$item.car_number2}</td>

                                            <td>{$item.car_code}</td>

                                            <td>{$item.egine_number}</td>

                                            <td>{$item.brand_models}</td>

                                            <td>{$item.register_time}</td>

                                            <td>{$item.create_time}</td>

                                            <td>

                                                {switch name="$item.status"}

                                                {case 1}未确认{/case}

                                                {case 2}已确认{/case}

                                                {/switch}

                                            </td>

                                            <td><img src="__PUBLIC__/{$item.single_pic|default=''}"  height="50" onerror="this.src='/static/console/images/default.png'"/></td>

                                            <td class="operate">



                                                <div>

                                                    <a target="_blank" {notin name="$item.status" value="2,3,4,5,6"}onclick="dayin()"{else/}href="{:url('gift_order/update', ['car_code' => $item.car_code,'brand_models' => $item.brand_models,'car_tel' => $item.car_tel,'car_name' => $item['car_name'],'id' => $item['order_id'],'car_number' => $item['car_number'],'is_certification_text' =>'AAAAAAAAAA','table' => 1,'car_number2' => $item['car_number2'],'order_number_two' => $item['order_number_two'],'gid' =>$item['id']])}"{/notin}

                                                    class="label label-success" style="margin-left: 10px;">

                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;打印提成

                                                    </a>

                                                    {if condition="session('role_id') eq 1 || (session('role_id') eq 5 && $item.status eq 2)"}

                                                    <a href="{:url('gift_order/update', ['id' => $item['order_id']])}"

                                                       class="label label-primary">

                                                        <span class="fa fa-pencil"></span>&nbsp;进入订单

                                                    </a>
                                                    {/if}
													{if condition="session('shifou_chaoguan') eq 2 || $item.status eq 1"}
                                                    <a href="{:url('update', ['id' => $item['id'],'order_id' => input('order_id')])}"

                                                       class="label label-primary">

                                                        <span class="fa fa-pencil"></span>&nbsp;&nbsp;

                                                        {if condition="session('role_id') eq 5"}查 看{else/}编 辑{/if}

                                                    </a>

                                                    {/if}



                                                    <!--<a href="{:url('destroy', ['id' => $item['id']])}"-->

                                                       <!--class="label label-danger"-->

                                                       <!--onClick="return confirm('系统会自动删除类别下所有子类别，确定删除吗?')"-->

                                                    <!--&gt;-->

                                                        <!--<span class="fa fa-times"></span>&nbsp;&nbsp;删 除-->

                                                    <!--</a>-->

                                                </div>

                                            </td>

                                        </tr>

                                        {/volist}

                                        </tbody>

                                        <tbody align="left">

                                        <!--<tr>-->

                                            <!--<td colspan="5">-->

                                                <!--<span>选择：</span>-->

                                                <!--<a style="color:#428BCA"-->

                                                   <!--href="javascript:DelAllNone('{:url(\'Console/FeedbackType/destroy\')}');"-->

                                                   <!--onclick="return ConfDelAll(0);">选择删除</a>-->

                                                <!--&nbsp;&nbsp;&nbsp;&nbsp;-->

                                                <!--<span>控制：</span>-->

                                                <!--<a style="color:#428BCA"-->

                                                   <!--href="javascript:UpOrderID('{:url(\'console/FeedbackType/sorting\')}');">更新排序</a>-->

                                            <!--</td>-->

                                        <!--</tr>-->

                                        </tbody>

                                    </table>

                                    <!-- 分页 -->

                                    <div style="float: right;margin-top: -30px;">{$data->render()}</div>

                                </form>

                            </div>

                        </div>

                        <button type="button" class="btn btn-success" style="margin-top: 20px;" onClick="dc()">二级订单导出</button>

                    </div>



                </div>

            </div>



        </div>

        <!-- /page content -->

    </div>



</div>



{include file="public_foot" /}

<!-- public -->

<script src="__STATIC__/js/public.js"></script>

<!-- layer -->

<script src="__STATIC__/js/layer.js"></script>

<script>

    function dayin() {

        layer.msg('订单未支付,无法打印');

    }

    $('#interval_timer').daterangepicker(null,

        function(start, end, label) {

//                console.log(start.toISOString(), end.toISOString(), label);

        });

    //导出excel表格

    function dc() {



        if (confirm('确认要导出订单?')) {

            var title = "{:input('title',0)}";

            var both = "{:input('interval_timer')}";

            var both_arr = both.split("/");

            console.log(both);

            if (both_arr[0] == both_arr[1]) {

                layer.msg('选择时间区间为同1天!');

                return;

            }

            window.location.href = "{:url('excel')}?title=" + title+'&interval_timer='+both;

        }

    }

</script>

